package com.example.mobifin_busticket.views.adapter;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import com.example.mobifin_busticket.R;
import com.example.mobifin_busticket.models.Boarding_DropingPointModel;
import com.example.mobifin_busticket.models.SourceModel;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CustommenuListAdapter extends BaseAdapter {
	private Context mContext;
	private int id;
	private List<String> items;
	LayoutInflater vi;

	public CustommenuListAdapter(Context context, int customMenuList,
			List<String> items) {
		this.mContext = context;
		this.id = customMenuList;
		this.items = items;

	}

	class ViewHolder {
		public TextView tvItemName;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return items.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return items.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View mView = convertView;
		if (mView == null) {
			LayoutInflater vi = (LayoutInflater) mContext
					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			mView = vi.inflate(id, null);
		}

		TextView text = (TextView) mView.findViewById(R.id.tvCustomList);

		if (items.get(position) != null) {
			text.setTextColor(Color.BLACK);
			text.setText(items.get(position));
		}

		return mView;

	}

}
